|
Index mapping (or ''direct addressing'', or a ''trivial hash function'') in computer science describes using an array, in which each position corresponds to a key in the universe of possible values. The technique is most effective when the universe of keys is reasonably small, such that allocating an array with one position for every possible key is affordable. Its effectiveness comes from the fact that an arbitrary position in an array can be examined in constant time. ==Applicable arrays== There are many practical examples of data whose valid values are restricted within a small range. A trivial hash function is a suitable choice when such data needs to act as a lookup key. Some examples include: * month in the year (1–12) * day in the month (1–31) * day of the week (1–7) * human age (0–130) – e.g. lifecover actuary tables, fixed term mortgage * ASCII characters (0–127), encompassing common mathematical operator symbols, digits, punctuation marks and English language alphabet 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Index mapping」の詳細全文を読む スポンサード リンク
|